package com.scuec.tourismwebsite.service;

import com.scuec.tourismwebsite.entity.PostLike;
import com.scuec.tourismwebsite.mapper.PostLikeMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Collections;
import java.util.List;

@Service
public class PostLikeServiceImpl implements PostLikeService{
    @Autowired
    private PostLikeMapper postLikeMapper;


    @Override
    public int insertPostLike(int user_id, int post_id) {
        return postLikeMapper.insertPostLike(user_id, post_id);
    }

    @Override
    public int deletePostLike(int user_id, int post_id) {
        return postLikeMapper.deletePostLike(user_id, post_id);
    }

    @Override
    public List<PostLike> selectPostLikeById(int user_id, int post_id) {
        return postLikeMapper.selectPostLikeById(user_id, post_id);
    }

    @Override
    public List<PostLike> selectLikesByUserId(Integer user_id) {
        return postLikeMapper.selectLikesByUserId(user_id);
    }
}
